/**
 *AlwaysOnTopAction.java
 *@anthor Daniel Liu
 *2006-4-26 8:13:54
 **/
package org.lex.utils.logging.handler.action;

import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;

import javax.swing.AbstractAction;
import javax.swing.AbstractButton;
import javax.swing.Action;

public class AlwaysOnTopAction extends AbstractAction {
	private Window main = null;

	public AlwaysOnTopAction(Window frame) {
		super();
		this.main = frame;
		this.putValue(Action.NAME, "Always On Top");
		this.putValue(Action.MNEMONIC_KEY, KeyEvent.VK_T);
		this.putValue(Action.SELECTED_KEY, false);
	}

	public void actionPerformed(ActionEvent e) {
		main.setAlwaysOnTop(((AbstractButton) e.getSource()).isSelected());
	}
}
